<template>

    
  <a-layout id="components-layout-demo-custom-trigger">



    <a-layout-sider v-model="collapsed" :trigger="null" collapsible>
      <div class="logo">欢迎你，{{ username }}</div>

        <leftmenu :menu_number="3"></leftmenu>



      </a-layout-sider>

         <a-layout>
<headmenu></headmenu>
      <a-layout-content
        :style="{
          margin: '24px 16px',
          padding: '24px',
          background: '#fff',
          minHeight: '500px',
        }"
      >
           <a-breadcrumb>
    <a-breadcrumb-item>我申请的工单</a-breadcrumb-item>
    <!-- <a-breadcrumb-item><a href="">Application Center</a></a-breadcrumb-item> -->
    <!-- <a-breadcrumb-item><a href="">Application List</a></a-breadcrumb-item> -->
    <a-breadcrumb-item>我申请的工单</a-breadcrumb-item>
  </a-breadcrumb>
        <a-table bordered :data-source="dataSource" :columns="columns" :rowKey='record=>record.id'>
          <template slot="operation" slot-scope="text, record">
            <a-popconfirm
              title="是否跳转"
              @confirm="() => showmywork(record.id)"
            >
              <a href="Javascript:void(0)">查看详情</a>
            </a-popconfirm>
          </template>
        </a-table>
      </a-layout-content>
    </a-layout>
            </a-layout>
</template>

<script>
// 导入组件
import leftmenu from "./leftmenu.vue";
import headmenu from './headmenu.vue';
import { get_mywork } from "./axios_http/api";
export default {
  data() {
    return {
      username: localStorage.getItem("username"),
      collapsed: false,
      // 列
      columns: [
        { title: "name", dataIndex: "name" },
        { title: "id", dataIndex: "id" },

        // 指定操作列
        {
          title: "operation",
          dataIndex: "operation",
          scopedSlots: { customRender: "operation" },
        },
      ],
      // 具体数据
      dataSource: [],
    };
  },
  methods: {
      showmywork(work_id) {
          console.log(work_id)
          this.$router.push({name:"myWorkInfo", query:{"work_id": work_id}})
      }
  },
  components: {
    leftmenu: leftmenu,
    headmenu:headmenu,
    
  },
  created() {
    get_mywork().then((resp) => {
      console.log(resp);
      this.dataSource = resp.data;
    });
  },
};
</script>